struct Solution {}

fn main() {}

impl Solution {
    pub fn difference_of_sums(n: i32, m: i32) -> i32 {
        let mut ret = 0;
        for num in 1..=n {
            if num % m == 0 {
                ret -= num;
            } else {
                ret += num;
            }
        }
        ret
    }
}